package com.voice.call.utils;

import java.net.DatagramSocket;
import java.net.SocketException;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.voice.call.service.HandlerVosBillService;



@Component
public class UDPServer {
	
	private static final Logger log = LoggerFactory.getLogger(UDPServer.class);
	
	@Resource
	private HandlerVosBillService handlerVosBillService;
	
	@PostConstruct
	public void initUdpServer() throws SocketException{
		
		/* * 服务器端接受客户端的数据 */ 
		DatagramSocket socket = new DatagramSocket(23650); 
		log.info("***服务器端即将启动,等待客户端连接***"); 
		
		UDPServerThred st = new UDPServerThred(socket,handlerVosBillService); 
		st.start(); 
		
	}

}
